<?php
	require_once ("dataBase.php");
	connectDataBase("localhost", "root", "", "blueocean");
	$hotPageID=@$_GET["id"];
	$viewCountSQL="SELECT viewcount FROM hotpages WHERE id={$hotPageID}";
	$viewCountResult=mysql_query($viewCountSQL);
	$viewCount=mysql_fetch_row($viewCountResult)[0];
	$viewCount++;
	$addViewCountSQL="UPDATE hotpages SET viewcount={$viewCount} WHERE id={$hotPageID}";
	mysql_query($addViewCountSQL);
	$sql="SELECT * FROM hotpages WHERE id={$hotPageID}";
	$result=mysql_query($sql);
	if(mysql_num_rows($result)>0){
		$row=mysql_fetch_assoc($result);
		$arr=["backmsg"=>$row];
	}else{
		$arr=["backmgs"=>"爆炸了"];
	}
	echo json_encode($arr);
?>